package com.harmontronics.hanma.paas.paas.dto.input.process;

import cn.hutool.core.convert.Convert;
import com.harmontronics.hanma.paas.paas.domain.app.entity.HmCarbonCopy;
import lombok.Data;
import org.springframework.util.CollectionUtils;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @author ldb
 */
@Data
public class ProcessCommonInputValues {
    private List<HmCarbonCopyInput> carbonCopyInputs;
    private Map<String, Object> values;


    @Data
    public static class HmCarbonCopyInput {

        private Long userId;

        private String username;
    }


    public List<HmCarbonCopy> toCarbonCopyVo() {
        if (CollectionUtils.isEmpty(carbonCopyInputs)) {
            return new ArrayList<>();
        }
        return Convert.toList(HmCarbonCopy.class, this.carbonCopyInputs);
    }
}
